package com.servertrack

import grails.test.mixin.TestFor
import spock.lang.Specification

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Tur)
class TurTest {
	Tur tur	
   
     void testConstraintsTitleBlank() {
		tur = new Tur(title:"",description:"This is a good tur", dateCreated: new Date("1989/1/9"))
		assertFalse tur.validate()	
    }
	
	 void testConstraintsTitleSize() {
		tur = new Tur(title:"q",description:"This is a good tur", dateCreated: new Date("1989/1/9"))
		assertFalse tur.validate()
		
		tur = new Tur(title:"qweq3ew3roij3498rtj349t598tj945utjioerutoiwert5t4et45t4e5tw5w54tert54tert5t",description:"This is a good tur", dateCreated: new Date("1989/1/9"))
		assertFalse tur.validate()
	}	

    void testConstraintsDescriptionBlank() {
		tur = new Tur(title:"newName",description:"", dateCreated: new Date("1989/1/9"))
		assertFalse tur.validate()
    }	 
	
 
}

